package benchmarks.tpch.mongo.domain;

import java.util.Date;

public class Part extends TPCHDomain<Integer>{
//    CastTypes.LONG,   // p_partkey
//    CastTypes.STRING, // p_name
//    CastTypes.STRING, // p_mfgr
//    CastTypes.STRING, // p_brand
//    CastTypes.STRING, // p_type
//    CastTypes.LONG,   // p_size
//    CastTypes.STRING, // p_container
//    CastTypes.DOUBLE, // p_retailprice
//    CastTypes.STRING  // p_comment
    private int p_partkey; //1 //primary
    private String p_name; //2
    private String p_mfgr; //3
    private String p_brand; //4
    private String p_type; //5
    private int p_size; //6
    private String p_container; //7
    private double p_retailprice; //8
    private String p_comment; //9

    @Override
    public void setInt(int pos, int value) {
        if (pos == 1) {
            p_partkey = value;
        }
        else if (pos == 6) {
            p_size = value;
        } else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setDouble(int pos, double value) {
        if (pos == 8) {
            p_retailprice = value;
        } else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setString(int pos, String value) {
        if (pos == 2) {
            p_name = value;
        }
        else if (pos == 3) {
            p_mfgr = value;
        }
        else if (pos == 4) {
            p_brand = value;
        }
        else if (pos == 5) {
            p_type = value;
        }
        else if (pos == 7) {
            p_container = value;
        }
        else if (pos == 9) {
            p_comment = value;
        }
        else {
            System.out.println("Wrong pos");
        }
    }

    @Override
    public void setDate(int pos, Date value) {
        System.out.println("Wrong pos");
    }

    @Override
    public Integer getPrimaryKey() {
        return p_partkey;
    }

    public int getP_partkey() {
        return p_partkey;
    }

    public void setP_partkey(int p_partkey) {
        this.p_partkey = p_partkey;
    }

    public String getP_name() {
        return p_name;
    }

    public void setP_name(String p_name) {
        this.p_name = p_name;
    }

    public String getP_mfgr() {
        return p_mfgr;
    }

    public void setP_mfgr(String p_mfgr) {
        this.p_mfgr = p_mfgr;
    }

    public String getP_brand() {
        return p_brand;
    }

    public void setP_brand(String p_brand) {
        this.p_brand = p_brand;
    }

    public String getP_type() {
        return p_type;
    }

    public void setP_type(String p_type) {
        this.p_type = p_type;
    }

    public int getP_size() {
        return p_size;
    }

    public void setP_size(int p_size) {
        this.p_size = p_size;
    }

    public String getP_container() {
        return p_container;
    }

    public void setP_container(String p_container) {
        this.p_container = p_container;
    }

    public double getP_retailprice() {
        return p_retailprice;
    }

    public void setP_retailprice(double p_retailprice) {
        this.p_retailprice = p_retailprice;
    }

    public String getP_comment() {
        return p_comment;
    }

    public void setP_comment(String p_comment) {
        this.p_comment = p_comment;
    }
}
